<?php
/* @var $this ProjectController */
/* @var $model Project */

$this->breadcrumbs=array(
	'Projects'=>array('index'),
	$model->name,
);
if(!Yii::app()->user->isGuest){
$this->menu=array(
	array('label'=>'Show on Map', 'url'=>array('mapview/showonmap', 'id'=>$model->id, 'optVal'=>true)),
	array('label'=>'Manage this Project\'s Pictures', 'url'=>array('picture/index2','projId'=>$model->id)),
	array('label'=>'Add a Testimonial to this Project', 'url'=>array('testimonials/create','projId'=>$model->id)),
	array('label'=>'Add a Property to this Project', 'url'=>array('property/create','projId'=>$model->id)),
	array('label'=>'List Project', 'url'=>array('index')),
	array('label'=>'Create Project', 'url'=>array('create')),
	array('label'=>'Update Project', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete Project', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Project', 'url'=>array('admin')),
);
}else{
$this->menu=array(
	array('label'=>'Show on Map', 'url'=>array('mapview/showonmap', 'id'=>$model->id, 'optVal'=>true)),
	array('label'=>'List Project', 'url'=>array('index')),
);
}
?>
<h1><?php echo $model->name;// View Project #<?php echo $model->id; ?></h1>
<h3><?php echo $model->subtitle; ?></h3>
<h4><?php echo $model->address_details.', '.$model->city.', '.$model->province.', '.$model->country; ?></h4>
<!--<?php //parameters of flexpictureslider
Yii::app()->clientScript->registerCoreScript('jquery'); //if you do not set yet
 $this->widget('ext.FlexPictureSlider.FlexPictureSlider',
   array('imageBlockSelector' => '#myslider', //the jquery selector
 ));
//or with full custom parameters
 $this->widget('ext.FlexPictureSlider.FlexPictureSlider',
  array(
    'imageBlockSelector' => '#myslider', //the jquery selector
    'widthSlider' => '700', //or you can use jquery '$(window).width()/1.6',
    'heightSlider' => '250', //or you can use jquery '$(window).height()/1.6',
    'slideUnitSize' => 'px', //px or %
    'timeBetweenChangeSlider' => 4000,
    //'slideRandomStart' => true, //only for version 1.0
    'timeDelayAnimation' => 1000, //the time before slider starts in miliseconds
    'sliderStartFrom' => 0, //if sliderSuffle is set false, only for version 1.1
    'sliderSuffle' => true, //suffle the pictures for random display, only for version 1.1
   )); 
?>-->

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<script src="/rlc-cms/js/galleria-1.2.9.min.js"></script>
<div class="content">
<div id="galleria">

<?php
//print($pics);exit;
if($pics==null){
	echo CHtml::image(Yii::app()->request->baseUrl . '/images/uploaded/noimage.jpg' , 'alt 1');
}else{
	foreach ($pics as $pic){
		$i=1;
		echo CHtml::image(Yii::app()->request->baseUrl . '/images/uploaded/' . $pic->url , 'alt ' . $i);
		$i++;
	}
}
?>
</div>

<script>
            Galleria.loadTheme('/rlc-cms/js/galleria.classic.min.js');
            Galleria.run('#galleria', {
			 transition: 'fade',
    autoplay: 7000 // will move forward every 7 seconds
});
</script>
</div>

<?php /* seq image
$picsVal=array();
foreach ($pics as $pic){
	$i=0;
	$picsVal[] = array(
			'image'=>array('src'=>Yii::app()->request->baseUrl.'/images/uploaded/'.$pic->url),
		);
	$i++;	
}
//print_r($picsVal);exit;
$this->widget('application.extensions.seqimage.SeqImage',array(
'widthImage' => 700, 
'heightImage' => 300,
'slides'=> $picsVal,/*array(
		array(
			'image'=>array('src'=>Yii::app()->request->baseUrl.'/images/uploaded/'.$pic->url),            
			'link'=>array('url'=>'#','htmlOptions'=>array())
		),
))); */
?>
<br>
<?php $this->beginWidget('application.extensions.thumbnailer.Thumbnailer', array(
 
        'thumbsDir' => 'images/thumbs',
        'thumbWidth' => 100,
        'thumbHeight' => 75, // Optional
    )
	// This portion is captured by the widget
); ?>
<!--img src="images/uploaded/17Chrysanthemum.jpg" />
<img src="images/uploaded/17Desert.jpg" />
<img src="images/uploaded/17Hydrangeas.jpg" /-->
<?php $this->endWidget(); ?>

<?php /* fancy box comment
//create a link
echo  CHtml::link('link text goes here',"#data", array("id"=>"fancy-link")); 
 
//put fancybox on page
$this->widget('application.extensions.fancybox.EFancyBox', array(
        'target'=>'a#fancy-link',
        'config'=>array(),));  
?>
<br>  
<div style="display:none">
	<div id="data">
	<!--p>Contents of this div appear in fancybox</p-->
	<?php
	foreach ($pics as $pic){
		$i=1;
		echo CHtml::image(Yii::app()->request->baseUrl . '/images/uploaded/' . $pic->url , 'alt ' . $i);
		$i++;
	}
	?>
	</div>
</div>
<?php */ //comment end ?>
<br><br>
<h3>Building Features</h3>
<p><?php echo $model->building_features; ?></p>
<h3>Features</h3>
<p><?php echo $model->features; ?></p>
<h3>Amenities</h3>
<p><?php echo $model->amenities; ?></p>
<h3>List of Properties</h3>
<?php
if ($properties==null){
	echo 'No Properties';
}else{
	echo '<table><tr><th width =200><font color = #d60c0c>Unit Number</font></th><th width =200><font color = #d60c0c>Unit Type</th></font><th width =200><font color = #d60c0c>Unit Area</font></th><th width =200><font color = #d60c0c>Contract Price</font></th><tr>';
	foreach ($properties as $property){
		echo '<tr><td>'. CHtml::link($property->unit_number, array('property/view','id'=>$property->id)) .'</td><td>'. $property->unit_type .'</td><td>'. $property->unit_type .'</td><td>'. CHtml::link('Request Price', array('pricequote/requestprice', 'project'=>$model->name, 'property'=>$property->unit_number .'('. $property->unit_type .')', 'id'=>$model->id)) . '</td></tr>';
	}
	echo '</table>';
}
?>
<br><br>
<h3>Client Testimonials</h3>
<?php
if ($testimonials==null){
	echo 'No Testimonials';
}else{
	echo '<table><tr><th width =200><font color = #d60c0c>Name</font></th><th width =200><font color = #d60c0c>Content</th></font><tr>';
	foreach ($testimonials as $testimonial){
		echo '<tr><td>'. $testimonial->name .'</td><td>'. $testimonial->content .'</td></tr>';
	}
	echo '</table>';
}
?>
<?php 
/*
$this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id',
		'name',
		'subtitle',
		'description',
		'brief',
		'location',
		'address_details',
		'city',
		'province',
		'country',
		'building_features',
		'features',
		'amenities',
		'latlng',
	),
)); 
*/
?>
